﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Xinrui.Core.IRepository;
using Xinrui.Core.IRepository.Base;
using Xinrui.Core.IServices;
using Xinrui.Core.Models.Base;
using Xinrui.Core.Services;

namespace Xinrui.Core.Controllers
{
    public class BlogArticleController : BaseController
    {
         readonly IBlogArticleService _blogArticleService;

        public BlogArticleController(IBlogArticleService blogArticleService)
        {
            _blogArticleService = blogArticleService;
        }
        [HttpGet]
        public async Task<List<BlogArticle>> GetBlog(int id)
        {
            
            return await _blogArticleService.Query(d=>d.bID==id);
        }
    }
}